#include<stdio.h>
#include<unistd.h>
#include<sys/types.h>
#include<stdlib.h>

int main()
{
    int a = 100;
    pid_t id = fork();
    if(id == 0)
    {
        while(1)
        {
            a = 220;
            printf("子进程：a:%d,&a:%p\n",a,&a);
            sleep(1);
        }
    }
    else 
    {
        while(1)
        {
            printf("父进程: a:%d,&a:%p\n",a,&a);
            sleep(1);
        }
    }

    return 0;
}
